package com.example.content_android;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.bumptech.glide.Glide;
import com.youth.banner.Banner;

import java.util.ArrayList;
import java.util.List;
//import com.youth.banner.adapter.BannerImageAdapter;
//import com.youth.banner.holder.BannerImageHolder;
//import com.youth.banner.indicator.CircleIndicator;
//
//import java.util.ArrayList;
//import java.util.List;

public class BannerActivity extends AppCompatActivity {
//    Banner banner;
    List<String> bannerList = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_banner);
//        banner = findViewById(R.id.banner);
        bannerList.add("https://p2.itc.cn/images01/20210510/096eeb9cd3c84bd8ba09b5713679b4f9.jpeg");
        bannerList.add("https://p2.itc.cn/images01/20210510/096eeb9cd3c84bd8ba09b5713679b4f9.jpeg");
        bannerList.add("http://i0.hdslb.com/bfs/article/97549c0fd58b940c1306faac923a8685551a6a2a.jpg");
//        banner.setAdapter(new BannerImageAdapter<String>(bannerList) {
//            @Override
//            public void onBindView(BannerImageHolder holder, String data, int position, int size) {
//                Glide.with(holder.imageView)
//                        .load(data)
//                        .into(holder.imageView);
//            }
//        });
//        //轮播图下面的原点
//        banner.setIndicator(new CircleIndicator(this));
//        banner.setIndicatorRadius(50);
        Banner banner = (Banner) findViewById(R.id.banner);
        //设置图片加载器
        banner.setImageLoader(new GlideImageLoader());
        //设置图片集合
        banner.setImages(bannerList);
        //banner设置方法全部调用完毕时最后调用
        banner.start();


    }
}

